package com.hans.scala

/**
 * @author juntao zhang
 * @since 2015/10/26 18:06
 */
object ScalaDemo extends App {

  def testLoop(con: => Boolean)(f: => Unit) {
    if (con) {
      f
      testLoop(con)(f)
    }
  }

  var count = 0
  testLoop(count < 5) {
    println(count)
    count += 1
  }
}
